package cn.ml.sboot11.controller;

import cn.ml.sboot11.service.ThreadServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/do")
public class ThreadController {
    @Autowired
    private ThreadServiceImpl threadService;

    @GetMapping("/long")
    public String doLong(){
        int count = 20;
        for (int i = 0; i < count; i++) {
            threadService.doLong("index = " + i);
        }

        return "success";
    }

}
